﻿using System;
using System.Reflection;

namespace Affinity.Flux
{
    /// <summary>
    /// Defines an outlet.
    /// </summary>
    public class OutletDefinition
    {
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="member"></param>
        /// <param name="contract"></param>
        /// <param name="flags"></param>
        public OutletDefinition(MemberInfo member, Contract contract, OutletFlags flags)
        {
            _Member = member;
            _Contract = contract;
            _Flags = flags;
        }

        /// <summary>
        /// Gets the contract.
        /// </summary>
        public Contract Contract
        {
            get { return _Contract; }
        }

        /// <summary>
        /// Gets the flags.
        /// </summary>
        public OutletFlags Flags
        {
            get { return _Flags; }
        }

        /// <summary>
        /// Gets the member (PropertyInfo or MethodInfo).
        /// </summary>
        public MemberInfo Member
        {
            get { return _Member; }
        }

        private readonly Contract _Contract;
        private readonly OutletFlags _Flags = OutletFlags.None;
        private readonly MemberInfo _Member;
    }
}
